//账户余额
$(function(){
	var model;
	$.ajax({
		url : '/web-adv/balance',
		data : model,
		type : 'post',
		success : function(data){
			var aBalance=data.actualBalance,spend=data.spending,tConsumption=data.totalConsumption,advertiserBal=data.advertiserBalance;
			//加上2位小数点
			var spending=spend.toFixed(2);
			var advertiserBalance =advertiserBal.toFixed(2);
			//数据为空时，显示0
			var zer=0;
			var zero=zer.toFixed(2);
			
			if(aBalance==null){				
				aBalance=zero;
			}
			if(spending==null){
				spending=zero;
			}
			if(tConsumption==null){
				tConsumption=zero;
			}
			$("#actualBalance1").html(aBalance);
			$("#advertiserBalance").html(advertiserBalance);
			$("#spending").html(spending);
			$("#totalConsumption").html(tConsumption);
		},
		error : function(){
			console.log("err");
		}
	})
})

